<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
	"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<title>navigation</title>
	<link rel="stylesheet" href="../tests.css" type="text/css" media="screen" title="no title" charset="utf-8" />
	<!--[if lt IE 8]>
		<link rel="stylesheet" href="../tests_ie.css" type="text/css" media="screen" title="no title" charset="utf-8" />
	<![endif]-->

	<script src="../../../lib/jquery.js" type="text/javascript" charset="utf-8"></script>	
	<script type="text/javascript" charset="utf-8">
		var tests = {
			Dhonishow_effect: ["effect_appear", "effect_resize"],
			Dhonishow_duration: ["duration_0", "duration_0dot6", "duration_2", "duration_2dot5"],
			Dhonishow_preloader: ["preloader_false", "preloader_true"],
			Dhonishow_autoplay: ["autoplay_1_duration_3", "autoplay_4_duration_1", "autoplay_4dot5_effect_resize"],
			Dhonishow_hide: ["hide_paging", "hide_alt", "hide_navigation", "hide_buttons"],
			Dhonishow_center: ["center_true", "center_false", "center_true_effect_resize", "center-height-width", "center-width_480", "center-height_480", "center-height_280", "center-width_280", "center-height-width_minor", "center-height-width_effect_resize"],
			Dhonishow_other: ["multiple_shows", "images_wrapped", "link_in_attribute", "no_images", "no_javascript"]
		};
		
		jQuery.fn.testNavigation = function(tests){
			var createNavigation = function(element, urlStr){
				var navigation = "";
				var testName;
        urlStr = urlStr || ".";
				if(element.constructor == Object){
          for(var test in element){
            navigation += "<li>";
            
            navigation += "<h2><a href=''>"+test+"</a></h2>";
            
            if(element[test].constructor == Array){
              navigation += "<ul>";
              navigation += arguments.callee(element[test], urlStr+"/"+test);
              navigation += "</ul>";
            }

						if(element[test].constructor == Object){
							navigation += "<ul>";
							navigation += arguments.callee(element[test], urlStr+"/"+test);
							navigation += "</ul>";
						}
						
						navigation += "</li>";
					}
				}
				
				if(element.constructor == Array){
					for (var i=0; i < element.length; i++) {            
						navigation += "<li>";
						navigation += '<a target="test" href="'+urlStr+"/"+element[i]+".html"+'">'+element[i]+"</a>";
						navigation += "</li>";
					};
				}
							  
				return navigation;
			};
			
			jQuery(this).append(createNavigation(tests));
			
		};
		
		jQuery(function(){
			jQuery("body").append('<ul id="navigation"></ul>');
			jQuery("#navigation").testNavigation(tests);
			
			$("#navigation ul").hide();
			
			$("body").click(function(e){
				if($(e.target).parents("h2").size() > 0){
					$(e.target).parents("h2").next().animate({
						opacity: "toggle",
						height: "toggle"
					});
					return false;
				}
			});
			
						
			var change = function(){
				$("#navigation ul a").attr("target", $(this).val());
			};
			
		});

	</script>
</head>
<body>
	<h1>Functional tests</h1>
	<!--<form style="display:none;">
		<div>
			<label for="in_frame">Open in Frame:</label>
			<input id="in_frame" type="radio" name="open_in" class="radio" value="test" checked="checked" />
		</div>
		<div>
			<label for="in_window">Open in new window:</label>
			<input id="in_window" type="radio" name="open_in" class="radio" value="_blank" />
		</div>
	</form>-->	
</body>
</html>